package nl.hu.verbrandendephoenix.client;

import java.util.ArrayList;

import nl.hu.verbrandendephoenix.shared.Auction;
import nl.hu.verbrandendephoenix.shared.Bid;
import nl.hu.verbrandendephoenix.shared.Message;
import nl.hu.verbrandendephoenix.shared.User;
import nl.hu.verbrandendephoenix.shared.Conversation;

import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

/**
 * The client side stub for the RPC service.
 */
@RemoteServiceRelativePath("localserver")
public interface ServerService extends RemoteService {
	//User
	public abstract boolean validLogin(String unm);
	public abstract boolean createUser(String unm, String pwd, String eml);
	public abstract String loginUser(String unm, String pwd);
	public abstract User getUserData(String key);
	public abstract User getUserData(String key, String username);
	public abstract int getUserID(String key);
	public abstract boolean setUserData(String loginKey, User u);	
	public abstract ArrayList<String> searchUser(String strSearchInput);
	public abstract boolean blockUser(String loginKey, String username);
	public abstract boolean isAdmin(String loginKey);

	public abstract String[] getCategories();
	//Auctions
	public abstract ArrayList<Auction> searchAuction(String prodN, String minPrice, String maxPrice, String category);
	public abstract ArrayList<Auction> getMyAuctions(String LoginKey);
	public abstract ArrayList<Conversation> getConversations(User u);
	public abstract boolean createAuction(String text, String text2, int parseInt, String cookie, String itemText);
	public abstract Auction getAuctionData(int acID);
	public abstract int getAuctionOwnerID(int acID);
	public abstract boolean compareAuctionOwner(int acID, String LoginKey);
	public abstract boolean editAuction(int acID, Auction a);
	public abstract boolean deleteAuction(int acID);
	public abstract boolean checkCredits(int acID, String LoginKey);
	public abstract boolean payCredits(int acID, String LoginKey);
	public abstract boolean addCredits(int aantCreds, String LoginKey);
	public abstract boolean bidAuction(int acID, double price, String cookie);
	public abstract Bid getLatestOffer(int acID);
	public abstract boolean stopAuction(int acID);
	//Bids
	public abstract ArrayList<Bid> getAllHighestBids();
	public abstract User getUserFromID(int usID);
	public abstract ArrayList<Bid> getAllBidsFromID(int acID);
	public abstract boolean checkForBid(int aucID);
	//Statistics
	public abstract ArrayList<Auction> getTopAuctions();
	public abstract Bid getHighestBidDay(int day, int month, int year);
	public abstract Bid getHighestBidMonth(int month, int year);
	public abstract Bid getHighestBidYear(int year);
	//Conversations
	public abstract Conversation getConversationData(int index);
	public abstract Message storeMessage(int index, String text, User current_User, User conv_partner);
	public abstract boolean checkActive(int acID);
	public abstract User getUserData(int acID);
}